﻿/**
 * Created by xjchen on 2020-03-20.
 * */

#ifndef MIDDLEWARE_FILEREADER_H
#define MIDDLEWARE_FILEREADER_H


#include "DeviceReader.h"

class FileReader : public DeviceReader {

public:
    ~FileReader();

    FileReader(std::string filePath);

    FLOW_API void setLoopMode(bool loop);

    int64_t onRead(char *buffer, int64_t len) override;

    void stop() override;

private:
    FILE *fp = nullptr;
    std::string filePath;
    bool loop = false;
};


#endif /** MIDDLEWARE_FILEREADER_H */
